]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Explicitly set expand of St.Bin children
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 6 Dec 2023 14:46:12 +0000 (15:46 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 15 Dec 2023 14:45:37 +0000 (14:45 +0000)
Right now, St.Bin ignores the child's expand properties, and
instead expands the child if its alignment is set to FILL.

This will change when we replace the custom allocation code
with a layout manager, so to prepare for that, set the expand
property where needed to keep the expected behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3046>

js/gdm/loginDialog.js
js/ui/calendar.js
js/ui/dateMenu.js
js/ui/quickSettings.js
js/ui/screenshot.js
js/ui/search.js

index ba2a1ad71608d1d87374cd637269f851f1fa0240..f978112998c5070be94c371d544f89c5ff99bbcd 100644 (file)
@@ -50,6 +50,7 @@ export const UserListItem = GObject.registerClass({
     _init(user) {
         let layout = new St.BoxLayout({
             vertical: true,
+            x_expand: true,
         });
         super._init({
             style_class: 'login-dialog-user-list-item',
index 64663c5aff6df4f59e09a710dafd8c2c4861cdfc..6ab62c51bba9f972361f8c7e1f8dc586eb3feedf 100644 (file)
@@ -824,6 +824,7 @@ class NotificationTimeLabel extends St.Label {
             style_class: 'event-time',
             x_align: Clutter.ActorAlign.START,
             y_align: Clutter.ActorAlign.END,
+            x_expand: true,
         });
         this._datetime = datetime;
     }
index 525923c0e0421141120b12a7debeb6a8308f36ca..a66d9233bd98e72959584b9939c8fcabfb5eff7d 100644 (file)
@@ -63,7 +63,10 @@ class TodayButton extends St.Button {
             reactive: false,
         });
 
-        const hbox = new St.BoxLayout({vertical: true});
+        const hbox = new St.BoxLayout({
+            vertical: true,
+            x_expand: true,
+        });
         this.child = hbox;
 
         this._dayLabel = new St.Label({
index d53ae2f8bc89b505b78195e0b2b14b12e10b5ce1..6deff416c3aea947574213e5cfaae583eb0d310c 100644 (file)
@@ -62,7 +62,7 @@ export const QuickToggle = GObject.registerClass({
             ...params,
         });
 
-        this._box = new St.BoxLayout();
+        this._box = new St.BoxLayout({x_expand: true});
         this.set_child(this._box);
 
         const iconProps = {};
@@ -167,7 +167,7 @@ export const QuickMenuToggle = GObject.registerClass({
 
         this.add_style_class_name('quick-menu-toggle');
 
-        this._box = new St.BoxLayout();
+        this._box = new St.BoxLayout({x_expand: true});
         this.set_child(this._box);
 
         const contents = new QuickToggle({
@@ -264,7 +264,7 @@ export const QuickSlider = GObject.registerClass({
             hasMenu: true,
         });
 
-        const box = new St.BoxLayout();
+        const box = new St.BoxLayout({x_expand: true});
         this.set_child(box);
 
         const iconProps = {};
index 18926bf62ef6ca4e33790978d2d6089b3e45415a..8875d9325feb3e513c6d8cd785e949707919ed86 100644 (file)
@@ -1320,6 +1320,8 @@ export const ScreenshotUI = GObject.registerClass({
         this._captureButton = new St.Button({style_class: 'screenshot-ui-capture-button'});
         this._captureButton.set_child(new St.Widget({
             style_class: 'screenshot-ui-capture-button-circle',
+            x_expand: true,
+            y_expand: true,
         }));
         this.add_child(new Tooltip(this._captureButton, {
             /* Translators: since this string refers to an action,
index b90ab33acb90edabbec9918b1e33ec35dd8f7490..293aa196e8ef34442c30d74f0b58d92da750fafd 100644 (file)
@@ -286,7 +286,10 @@ class ListSearchResults extends SearchResultsBase {
     _init(provider, resultsView) {
         super._init(provider, resultsView);
 
-        this._container = new St.BoxLayout({style_class: 'search-section-content'});
+        this._container = new St.BoxLayout({
+            style_class: 'search-section-content',
+            x_expand: true,
+        });
         this.providerInfo = new ProviderInfo(provider);
         this.providerInfo.connect('key-focus-in', this._keyFocusIn.bind(this));
         this.providerInfo.connect('clicked', () => {